import React, { Component } from "react";
import { Globalstyle } from "./style";
import Header from "./common/header/Header.jsx";
import { GlobalIconstyle } from "./statics/iconfont/iconfont";
import store from "./store";
import { BrowserRouter, Route } from "react-router-dom";
import { Provider } from "react-redux";

//路由
import Home from "./pages/home/Home.jsx";
import Detail from "./pages/detail/Detail.jsx";
import Login from './pages/login/Login.jsx'
import Write from './pages/write/Write.jsx'

export default class App extends Component {
  constructor(props) {
    super(props);
    this.state = {};
  }

  render() {
    return (
      <Provider store={store}>
        <Globalstyle />
        <GlobalIconstyle />
        <BrowserRouter>
          <Header />
          <Route exact path="/" component={Home}></Route>
          <Route exact path="/detail/:id" component={Detail}></Route>
          <Route exact path="/login" component={Login}></Route>
          <Route exact path="/write" component={Write}></Route>
          
        </BrowserRouter>
      </Provider>
    );
  }
}
